global without sharing class OpportunityWebService {
    
    webservice static String checkOpp(Id oppid){

        Opportunity opp = [select StageName,Account.ProvinceText__c,Account.CityText__c,AccountId,Account.RecordType.DeveloperName from Opportunity where id =:oppid];

        String msg ='';
        if(opp.StageName == '失败' ) return '已丢单的业务机会不能赢单!';
        if(opp.Account.RecordType.DeveloperName=='Maccura' && !System.Label.NOT_Win_Province.contains(opp.Account.ProvinceText__c)){
            msg = 'NG';           
            }else{
            msg = 'OK';
        }

         return msg;
        
    }

//	webservice static void getOpportunity(Id oppid) {
//     Opportunity opp = new Opportunity();
//     Opportunity copyopp = new Opportunity();
//     Schema.DescribeSobjectResult m = Opportunity.sObjectType.getDescribe();
//     Map<String, Schema.SObjectField> fieldMap = m.fields.getMap();
//     String sql = 'select ';
//     String fields = '';
//     for (String field : fieldMap.keySet()) {
//         if (fields.length() > 0) {
//             fields += ', ';
//         }
//         fields += field;
//     }
//     sql += fields;
//     sql += ' from Opportunity where id=:oppid';
//     opp = Database.query(sql);

// }
            

        
}